switch(mod) {
case 0:
- if (rm == 5) {
+ if (rm == 5 || rm == 4) {
if (op16)
inst = inst + 2; //disp16, skip 2 bytes
else
}
switch(*inst) {
+ case 0x81:
+ /* This is only a workaround for cmpl instruction*/
+ strcpy((char *)thread_inst->i_name, "cmp");
+ return DECODE_success;
+
case 0x88:
/* mov r8 to m8 */
thread_inst->op_size = BYTE;
__vmread(GUEST_RIP, &eip);
__vmread(INSTRUCTION_LEN, &inst_len);
-
__vmread(GUEST_RFLAGS, &eflags);
vm86 = eflags & X86_EFLAGS_VM;
inst_decoder_regs->eax, IOREQ_WRITE, 0);
return;
}
+ /* Workaround for cmp instruction */
+ if (!strncmp((char *)mmio_inst.i_name, "cmp", 3)) {
+ inst_decoder_regs->eflags &= ~X86_EFLAGS_ZF;
+ __vmwrite(GUEST_RFLAGS, inst_decoder_regs->eflags);
+ return;
+ }
domain_crash_synchronous();
}